6ac4a0276c7d3e8ee17993b1b26c3e88edfadbd7,microsoft-azure-storage/src/com/microsoft/azure/storage/blob/CloudBlob.java,CloudBlob,downloadRangeInternal,#number#number#number[]#number#AccessCondition#BlobRequestOptions#OperationContext#,1576

Before Change


            throw new IllegalArgumentException(SR.INVALID_RANGE_CONTENT_MD5_HEADER);
        }

        return ExecutionEngine.executeWithRetry(this.blobServiceClient, this, this.downloadToByteArrayImpl(blobOffset,
                length, buffer, bufferOffset, accessCondition, options, opContext), options.getRetryPolicyFactory(),
                opContext);
    }

    /**

After Change


     *             an exception representing any error which occurred during the operation.
     */
    @DoesServiceRequest
    protected final int downloadRangeInternal(final long blobOffset, final Long length, final byte[] buffer,
            final int bufferOffset, final AccessCondition accessCondition, BlobRequestOptions options,
            OperationContext opContext) throws StorageException {

        if (bufferOffset < 0 || blobOffset < 0 || (length != null && length <= 0)) {
            throw new IndexOutOfBoundsException();
        }

        if (opContext == null) {
            opContext = new OperationContext();
        }

        options = BlobRequestOptions.populateAndApplyDefaults(options, this.properties.getBlobType(), this.blobServiceClient);

        if (options.getUseTransactionalContentMD5() && (length != null && length > 4 * Constants.MB)) {
            throw new IllegalArgumentException(SR.INVALID_RANGE_CONTENT_MD5_HEADER);
        }

        WrappedByteArrayOutputStream outputStream = new WrappedByteArrayOutputStream(buffer, bufferOffset);
        ExecutionEngine.executeWithRetry(this.blobServiceClient, this,
                this.downloadToStreamImpl(blobOffset, length, outputStream, accessCondition, options, opContext),
                options.getRetryPolicyFactory(), opContext);
        return outputStream.getPosition();
    }

    /**